package ${dtoPackage};


import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

<#if columnHasMax>
import javax.validation.constraints.Max;
</#if>
<#if columnHasMin>
import javax.validation.constraints.Min;
</#if>
<#if columnHasNotNull>
import javax.validation.constraints.NotNull;
</#if>
<#if columnHasNotBlank>
 import javax.validation.constraints.NotBlank;
</#if>
<#if columnHasSize>
import javax.validation.constraints.Size;
</#if>
<#if dtoColumnHasDate>
import java.time.LocalDate;
</#if>
<#if dtoColumnHasDateTime>
import java.time.LocalDateTime;
</#if>
<#if dtoColumnHasTime>
import java.time.LocalTime;
</#if>

/**
 * 说明：${remarks}的提交对象
 *
 * @author ${author}
 * @date ${date}
 */
@Data
@Accessors(chain = true)
public class ${class}DTO{

    /**
     * ID
     */
    Long id;

<#list dtoAttrs as attr><#if attr.isSetDo>
    /**
     * ${attr.remarks}
     */
    <#if attr.hasMin>
    @Min(value = ${attr.minValue}, message = "${attr.remarks}不能小于{value}")
    </#if>
    <#if attr.hasMax>
    @Max(value = ${attr.maxValue}, message = "${attr.remarks}不能小于{value}")
    </#if>
    <#if attr.hasSize>
    @Size(max = ${attr.sizeMax}, message = "${attr.remarks}长度必须{max}个字符以内")
    </#if>
    <#if attr.hasNotNull>
    @NotNull(message = "${attr.remarks}不能为空")
    </#if>
    <#if attr.hasNotBlank>
    @NotBlank(message = "${attr.remarks}不能为空")
    </#if>
    ${attr.type} ${attr.name};

</#if></#list>
    /**
     * 备注
     */
    @Size(max = 1024, message = "备注长度必须{max}个字符以内")
    String remarks;
}
